public class Test4 {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 1; i < 101; i++) {
            int gewei = i % 10;
            int shiwei = i / 10;
            if (i == 9) {
                continue;
            }
            else if (gewei == 9 || shiwei == 9) {
                continue;
            }
            System.out.print(i + " ");
            count += 1;
            if (count > 4) {
                System.out.println("");
                count = 0;
            }
        }
    }
}